﻿@model IEnumerable<iDMS.Models.Manufacturer>
@using MvcHtmlHelpers
@{
    ViewBag.Title = "Index";
}
<script type="text/javascript">
    $(function () {
        $("a", "#list").button();

    });
</script>
<h3>
    Manufacturers</h3>
<p>
    @Html.ActionLink("Create New", "Create", null, new { @id = "CreateLink" })
    @using (Html.BeginForm("Index", "Manufacturer", FormMethod.Get))
    {   
        <p>
            Name: @Html.TextBox("search",null, new { @class = "searchTextBox" })
            <input type="submit" value="Filter" /></p>
    }
</p>
<div id="list">
    <table>
        <tr>
            <th>
            </th>
            <th>
                Name
            </th>
            <th>
                City
            </th>
            <th>
                Country
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.ActionLink("Details", "Details", new { id = item.ManufacturerID })
                </td>
                <td>
                    @Html.DisplayFor(model => item.Name)
                    @if (!item.isActive)
                    {
                        <span class="red">[deleted]</span>
                    }
                    @if (item.isHome)
                    {
                        <span class="ui-icon ui-icon-home">g</span>
                    }
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.City)
                </td>
                <td>
                    @Html.CountryFlag(item.Country.ISO3166Alfa2)
                </td>
            </tr>
        }
    </table>
</div>
